package com.topfinance.payment.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.topfinance.frame.dao.HibernateEntityDao;
import com.topfinance.frame.exception.AppException;
import com.topfinance.payment.ebo.TCfgConfigEbo;
import com.topfinance.payment.service.ITCfgConfigMgr;

/**
 * 该类自动实现了dao的一般方法，如add, remove, update
 * 在service中出现的大部分情况下是在向后台提交数据前的处理(如校验)及获取后台数据后的处理等
 * @author
 *
 */

public class TCfgConfigMgrImpl extends HibernateEntityDao<TCfgConfigEbo> implements ITCfgConfigMgr {

	private static final Log log = LogFactory.getLog(TC2MsgListMgrImpl.class);
	
	//获得传输协议	
	public TCfgConfigEbo getTCfgConfig(Integer oid) throws AppException{
		return (TCfgConfigEbo)get(oid);
	}

	public void deleteTCfgConfig(Integer oid) throws AppException{
		removeById(TCfgConfigEbo.class,oid);
	}

	//获得传输协议列表
	public List<TCfgConfigEbo> getAllConfig() throws AppException{
		String hql = " from TCfgConfigEbo t " ;
		String where = "";
		List<Object> paramList = new ArrayList<Object>();
		if (isNotBlank(where)) {
			where = " where " + where;
		}
		hql = hql + where;
		return find(hql,paramList.toArray());		
	}
}
